package com.ningmengs789.live;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Environment;

public class Const {

    /**
     * NLog 开关
     */
    public static final boolean IS_DEBUG = true;

    /*域名*/
    public static String getDomain(){
//        return "http://jf.ningmeng2021.com";

        return "http://api.app.hnmyxxkj.com";


    }

    /*Socket 域名*/
    public static String getSocketDomain(){
//        return "http://jf.ningmeng2021.com/ws";
        return "http://api.app.hnmyxxkj.com/ws";

    }


    /*####主题颜色####*/
    /*图片域名*/
    public static final String domain_url = "https://dcyun-1257995576.picsh.myqcloud.com/";//TODO
    public static String domain_url2 = "http://upf.app.ningmeng2021.com/";

    /*bugly(无需可忽略)*///TODO
    public static final String buglyAppid = "44d00d78eb";

    /*腾讯鉴权URL*/
    public static final String license_url = "http://license.vod2.myqcloud.com/license/v1/12e3bc8963be986ff43ca2975cf13d60/TXLiveSDK.licence";
    public static final String license_key = "5675251f4c6af6317fd8e497d97d32c5";

    /*短视频鉴权URL*/
    public static final String license_ugc_url = "http://license.vod2.myqcloud.com/license/v1/12e3bc8963be986ff43ca2975cf13d60/TXLiveSDK.licence";
    public static final String license_ugc_key = "0bd2b576f939abeeb89929e3387316f7";

    /*微信*///TODO
    public static final String wx_app_id = "wxc5504549a9e25310";
    public static final String wx_app_secret = "792a4b0c50598cb8f6a0cd6740131f5e";

    /*QQ*/
    public static final String qq_app_id = "101929175";
    public static final String qq_app_secret = "26b5898301c08567fabf1afee0e01908";

    /*云通信IM*/
    public static int im_app_id = 1400466671;
    public static final String account_type = "36862";

    /*腾讯cos*///TODO
//    public static final String region = "ap-shanghai";
//    public static final String bucket = "dcyun-1257995576";
//    public static final String secretId = "AKIDrcEjngPwISVP70aX4PXVItHViniUDdw4";
//    public static final String secretKey = "4xeAUedTGuMcfXDgz5zhHfsumV4SdjAT";

    public static final String region = "ap-nanjing";
    public static final String bucket = "qm-1307115478";
    public static final String secretId = "AKIDykGWXHlyvb094iALGuHNDn56rLYUN4Vg";
    public static final String secretKey = "zjDRQAesqZ3HFxQcYHjvqVv61mIZaLq6";

    /**
     * zh-tw 繁体
     * zh-cn 简体
     * en-us 英语
     */
    public static final String LANGUAGE = "en-us";



    /*抢聊自动刷新时间间隔*/
    public static final int vperiod_time = 30;

    public static final boolean IS_COS = false;//是否使用腾讯COS上传

    //外部sd卡
    public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
    //内部存储 /data/data/<application package>/files目录
    public static final String INNER_PATH = App.getInstance().getFilesDir().getAbsolutePath();
    //文件夹名字
    private static final String DIR_NAME = "dachuyun";
    //保存视频的时候，在sd卡存储短视频的路径DCIM下
    public static final String VIDEO_PATH = DCMI_PATH + "/" + DIR_NAME + "/video/";
    public static final String VIDEO_RECORD_TEMP_PATH = VIDEO_PATH + "recordParts";


    public static final String SAVE_PIC_PATH = Environment.getExternalStorageState().equalsIgnoreCase(Environment.MEDIA_MOUNTED) ? Environment.getExternalStorageDirectory().getAbsolutePath() : "/mnt/sdcard";
    public static final String REAL_PIC_PATH = SAVE_PIC_PATH + "/" + BuildConfig.APPLICATION_ID + "/xchat";
    public static String cropDir = REAL_PIC_PATH + "/ImageCrop";//裁剪图片暂存路径
    public static String voiceDir = REAL_PIC_PATH + "/SoundRecorder";//裁剪图片暂存路径
    public static String downloadDir = SAVE_PIC_PATH + "/download";//裁剪图片暂存路径

    public static float ratio = 1.4f;

    public static String getMetaDataString(String key) {
        String res = null;
        try {
            ApplicationInfo appInfo = App.getInstance().getPackageManager()
                    .getApplicationInfo(App.getInstance().getPackageName(), PackageManager.GET_META_DATA);
            res = appInfo.metaData.getString(key).trim();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return res;
    }

    private static boolean getMetaDataBoolean(String key) {
        boolean res = false;
        try {
            ApplicationInfo appInfo = App.getInstance().getPackageManager()
                    .getApplicationInfo(App.getInstance().getPackageName(), PackageManager.GET_META_DATA);
            res = appInfo.metaData.getBoolean(key);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return res;
    }

    public static long getMetaDataLong(String key) {
        long res = 0;
        try {
            ApplicationInfo appInfo = App.getInstance().getPackageManager()
                    .getApplicationInfo(App.getInstance().getPackageName(), PackageManager.GET_META_DATA);
            res = appInfo.metaData.getInt(key, 0);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return res;
    }
}
